home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / public / fax / src / etc / dialrules < prev    next >
Text File  |  1994-08-01  |  2KB  |  47 lines

  1. ! $Header: /usr/people/sam/fax/etc/RCS/dialrules,v 1.2 1993/05/06 11:34:09 sam Rel $
  2. !
  3. ! FlexFAX Dialing String Processing Rules.
  4. !
  5. ! This file describes how to process user-specified dialing strings
  6. ! to create two items:
  7. !
  8. ! CanonicalNumber: a unique string that is derived from all dialing
  9. ! strings to the same destination phone number.  This string is used
  10. ! by the fax server for ``naming'' the destination. 
  11. !
  12. ! DialString: the string passed to the modem for use in dialing the
  13. ! telephone.  This string should be void of any characters that might
  14. ! confuse the modem.
  15. !
  16. Area=${AreaCode}        ! local area code
  17. Country=${CountryCode}        ! local country code
  18. IDPrefix=${InternationalPrefix}    ! prefix for placing an international call
  19. LDPrefix=${LongDistancePrefix}    ! prefix for placing a long distance call
  20. !
  21. WS="     "            ! our notion of white space
  22. !
  23. ! Convert a phone number to a canonical format:
  24. !
  25. !    +<country><areacode><rest>
  26. !
  27. ! by (possibly) stripping off leading dialing prefixes for
  28. ! long distance and/or international dialing.
  29. !
  30. CanonicalNumber := [
  31. #.*            =            ! strip calling card stuff
  32. [^+0-9]+        =            ! strip white space etc.
  33. ^${IDPrefix}        = +            ! replace int. dialing code
  34. ^${LDPrefix}        = +${Country}        ! replace l.d. dialing code
  35. ^[^+]            = +${Country}${Area}&    ! otherwise, insert canon form
  36. ]
  37. !
  38. ! Process a dialing string according to local requirements.
  39. ! These rules do only one transformation: they convert in-country
  40. ! international calls to long-distance calls.
  41. !
  42. DialString := [
  43. [-${WS}.]+        =            ! strip syntactic sugar
  44. ^[+]${Country}        = ${LDPrefix}        ! long distance call
  45. ^[+]            = ${IDPrefix}        ! international call
  46. ]
  47.